﻿using System;

class LexicographicallyCompare
{
    static bool AreEqual(string[] a, string[] b)
    {
        bool flag = true;
        for (int i = 0; i < a.Length; i++)
        {
            if (a[i] != b[i])
            {
                flag = false;
            }
        }

        if ((a.Length == b.Length) && flag)
        {
            return true;
        }
        return false;
    }


    static void Main()
    {
        Console.WriteLine("Enter the length of array1:");
        int n = int.Parse(Console.ReadLine());
        Console.WriteLine("Enter the length of array2:");
        int m = int.Parse(Console.ReadLine());
        char[] arr1 = new char[n];
        char[] arr2 = new char[m];
        for (int i = 0; i < arr1.Length; i++)
        {
            arr1[i] = char.Parse(Console.ReadLine());
        }
        for (int i = 0; i < arr2.Length; i++)
        {
            arr2[i] = char.Parse(Console.ReadLine());
        }
        string str1 = arr1.ToString();
        Console.WriteLine(str1);
        string str2 = arr2.ToString();
        Console.WriteLine("Comparison of '{0}' and '{1}': {2}",
                        str1, str2, str1.CompareTo(str2));
    }
}

